import React , {Component} from "react";
import {Navigate,HashRouter,Routes,Route,BrowserRouter} from 'react-router-dom';
import Login from './pages/Login';
import NavPage from './pages/nav';
const Home = React.lazy(() => import("./pages/Home"))
const ShopList = React.lazy(() => import("./pages/shop/ShopList"));
const AddShop = React.lazy(() => import("./pages/shop/AddShop"));
const AccountsList = React.lazy(() => import("./pages/accounts/AccountsList"));
const AddAccount = React.lazy(() => import("./pages/accounts/AddAccount"));
const NotFound = React.lazy(() => import("./pages/NotFound"));
export default class App extends Component{
	render(){
		return ( 
		<React.Suspense>
		  <HashRouter>
		     <Routes>
		  		 <Route path='/' element={<Navigate to="/login" />} />
		  		 <Route path="/login" element={<Login />} />
		  		 <Route path="/nav" element={<NavPage />} >
		  		   <Route path="home" element={<Home />} />
		  		   <Route path="shopList" element={<ShopList />} />
		  		   <Route path="addShop" element={<AddShop />} />
		  		   <Route path="accountsList" element={<AccountsList />} />
		  		   <Route path="addAccount" element={<AddAccount />} />
		  		 </Route>
				 <Route path="*" element={<NotFound />} />
				 </Routes>
		  </HashRouter>
		</React.Suspense>
		 
		  )
	}
}